// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
  const table = {
      key: 'Id',
      footer: "Foots",
      cnName: '点检保养项目',
      name: 'MaintenanceChecklist',
      url: "/MaintenanceChecklist/",
      sortName: "Id"
  };
  const tableName = table.name;
  const tableCNName = table.cnName;
  const newTabEdit = false;
  const key = table.key;
  const editFormFields = {"ProjectName":"","ProjectCode":"","ProjectType":"","ProjectContent":"","Standard":"","Status":"","Remark":"","autoCreate":0};
  const editFormOptions = [
      [
          {
              "title":"项目编码",
              "field":"ProjectCode",
              "type":"text",
              "required": true,
              "colSize": 8,
              "width": 500,
              "maxlength": 20
          },
          {
              "title":"",
              "field":"autoCreate",
              "type":"switch",
              "value": 0,
              "colSize": 4,
              "onChange": (val, option) => {
                  if (val) {
                      option.data.ProjectCode = 'SUB' + Math.floor(Math.random() * 900 + 100);
                  } else {
                      option.data.ProjectCode = '';
                      // 强制更新表单
                      option.form && option.form.$refs.form && option.form.$refs.form.validate(false);
                  }
              },
              "extra": {
                  "style": "margin-left: 5px;display: inline-flex;align-items: center;"
              }
          }
      ],
      [
          {"title":"项目名称","field":"ProjectName","type":"text","required": true,"colSize": 12,"maxlength": 100}
      ],
      [
          {"dataKey":"项目类型","data":[],"title":"项目类型","field":"ProjectType","type":"radio","required": true,"colSize": 12}
      ],
      [
          {"title":"项目内容","field":"ProjectContent","type":"textarea","required": true,"colSize": 12,"maxlength": 500}
      ],
      [
          {"title":"标准","field":"Standard","type":"text","required": true,"colSize": 6,"maxlength": 200},
          {"dataKey":"enable","data":[{label:"是",value:1},{label:"否",value:0}],"title":"是否启用","field":"Status","type":"radio","colSize": 6}
      ],
      [
          {
              "title": "备注",
              "field": "Remark",
              "type": "textarea",
              "colSize": 12,
              "maxlength": 500,
              "placeholder": "请输入备注信息"
          }
      ]
  ];
  const searchFormFields = {"ProjectName":"","ProjectCode":"","ProjectType":""};
  const searchFormOptions = [[{"title":"项目编码","field":"ProjectCode","type":"="},{"title":"项目名称","field":"ProjectName","type":"like"},{"dataKey":"项目类型","data":[],"title":"项目类型","field":"ProjectType","type":"select"}]];
  const columns = [{field:'Id',title:'主键',type:'int',width:110,require:true,align:'left'},
                     {field:'ProjectName',title:'项目名称',type:'string',width:110,align:'left'},
                     {field:'ProjectCode',title:'项目编码',type:'string',width:110,align:'left'},
                     {field:'ProjectType',title:'项目类型',type:'string',bind:{ key:'项目类型',data:[]},width:110,align:'left'},
                     {field:'ProjectContent',title:'项目内容',type:'string',width:110,align:'left'},
                     {field:'Standard',title:'标准',type:'string',width:110,align:'left'},
                     {field:'Status',title:'是否启用',type:'int',bind:{ key:'enable',data:[{label:"是",value:1},{label:"否",value:0}]},width:110,align:'left'},
                     {field:'Remark',title:'备注',type:'string',width:110,align:'left'}];
  const detail ={columns:[]};
  const details = [];

  return {
      table,
      key,
      tableName,
      tableCNName,
      newTabEdit,
      editFormFields,
      editFormOptions,
      searchFormFields,
      searchFormOptions,
      columns,
      detail,
      details
  };
}